
<div class="content-section implementation GridDemo clearfixes">
  <div class="mysearch">
    <ng-container *ngFor="let tab of tabs;let i = index">
      <button pButton type="button"  label="{{tab.label}}" (click)="changeTab(i)"></button>
    </ng-container>
  </div>
  <ng-container [ngSwitch]= tabIndex>
    <div class="contentInfo" *ngSwitchCase="0" >
      <form class="form-horizontal storage construction" [formGroup]="constructionForm"   >
          <p-panel >
              <p-header>
                  <div class="ui-helper-clearfix">
                      <span class="ui-panel-title" style="font-size:16px;display:inline-block;margin-top:2px"></span>
                      <button class="save"  pButton type="button"  label="返回" (click)="goBack(currentContruction[i])"  > </button>
                      <button class="save" pButton [ngStyle]="{'float':'right'}"   *ngFor="let optbutton of optButtons"  label="{{optbutton.label}}" (click)="approvedOption(optbutton.status)" [disabled]="!constructionForm.valid" ></button>
                  </div>
              </p-header>
              <div class="ui-grid ui-grid-responsive ui-grid-pad ui-fluid" style="margin: 10px 0px">

                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >施工单号:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="sid"  name="inspectionName"   type="text" pInputText    [(ngModel)]="currentContruction.sid"  readonly>
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >状态:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input formControlName="status"  name="keeper_pid"  type="text" pInputText   readonly [(ngModel)]="currentContruction.status">
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >受理人:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="creator"  name="inspectionName"   type="text" pInputText   placeholder="受理人"  readonly [(ngModel)]="currentContruction.creator">
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >受理时间:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="create_time"  name="inspectionName"   type="text" pInputText     readonly [(ngModel)]="currentContruction.create_time">
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >申请人:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="submitter"  name="inspectionName"   type="text" pInputText     readonly  [(ngModel)]="currentContruction.submitter" >
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >申请时间:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="submit_time"  name="inspectionName"   type="text" pInputText     readonly  [(ngModel)]="currentContruction.submit_time">

                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >所属组织:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="submitter_org"  name="inspectionName"   type="text" pInputText  readonly  [(ngModel)]="currentContruction.submitter_org">
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >计划开始时间:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="construction_plantime_start"  name="inspectionName"   type="text" pInputText   readonly [(ngModel)]="currentContruction.construction_plantime_start">

                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >联系电话:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="submitter_phone"  name="inspectionName"   type="text" pInputText   readonly  [(ngModel)]="currentContruction.submitter_phone">
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >计划结束时间:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input  formControlName="construction_plantime_end"  name="inspectionName"   type="text" pInputText   placeholder="申请人"  readonly [(ngModel)]="currentContruction.construction_plantime_end">
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >施工类型:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input formControlName="construction_type"  type="text" pInputText  name="inspectiondepartment"
                                 readonly class="cursor_not_allowed"  [(ngModel)]="currentContruction.construction_type" />
                      </div>
                      <div class="ui-grid-col-1 text-right">
                          <label >部门审批人:</label>
                      </div>
                      <div class="ui-grid-col-5">
                          <input formControlName="org_approver"  type="text" pInputText  name="inspectiondepartment"
                                 readonly class="cursor_not_allowed"  [(ngModel)]="currentContruction.org_approver" />

                      </div>

                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 ui-padding-10px text-right">
                          <label >影响业务:</label>
                      </div>
                      <div class="ui-grid-col-5">
                        <ng-container *ngFor="let radio of radioButton">
                          <p-radioButton formControlName="is_affected" name="group" value="{{radio.value}}" label="{{radio.label}}"  [(ngModel)]="currentContruction.is_affected"></p-radioButton>
                        </ng-container>
                      </div>
                      <div class="ui-grid-col-1 text-right" *ngIf="currentContruction.is_affected === 'true'">
                          <label >影响时间:</label>
                      </div>
                      <div class="ui-grid-col-5" *ngIf="currentContruction.is_affected === 'true'">
                          <input  formControlName="construction_affecttime_start"  name="inspectionName"   type="text" pInputText   readonly [(ngModel)]="currentContruction.construction_affecttime_start" >

                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 text-right">
                          <label >施工区域:</label>
                      </div>
                      <div class="ui-grid-col-11">
                          <input formControlName="construct_location"  type="text" pInputText  name="inspectiondepartment" placeholder="施工区域"
                                 readonly class="cursor_not_allowed"  [(ngModel)]="currentContruction.construct_location"  />
                      </div>

                  </div>
                  <div class="ui-grid-row margin-bottom-1vw" *ngIf="currentContruction.is_affected === 'true'">
                      <div class="ui-grid-col-1 text-right">
                          <label >影响区域:</label>
                      </div>
                      <div class="ui-grid-col-11">
                          <input formControlName="affected_location"  type="text" pInputText  name="inspectiondepartment" placeholder="影响区域"
                                 readonly class="cursor_not_allowed"  [(ngModel)]="currentContruction.affected_location" />
                      </div>

                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 text-right">
                          <label ><span></span>施工内容:</label>
                      </div>
                      <div class="ui-grid-col-11">
                          <textarea formControlName="construction_content" name="jianshu" pInputTextarea type="text" readonly [(ngModel)]="currentContruction.construction_content"  ></textarea>
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 text-right">
                          <label ><span></span>施工内容详述:</label>
                      </div>
                      <div class="ui-grid-col-11">
                          <textarea formControlName="construction_description" name="jianshu" pInputTextarea type="text" readonly [(ngModel)]="currentContruction.construction_description"  ></textarea>
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 text-right">
                          <label >附件:</label>
                      </div>
                      <div class="ui-grid-col-11">
                        <div *ngFor="let files of currentContruction.construction_apply_attachments" >
                          <a (click)="download()">{{ files['file_name'] }}</a>
                        </div>
                      </div>
                  </div>
                  <div class="ui-grid-row margin-bottom-1vw">
                      <div class="ui-grid-col-1 text-right">
                          <label ><span>*</span>审批意见:</label>
                      </div>
                      <div class="ui-grid-col-11">
                          <textarea formControlName="approve_opinion" name="jianshu" pInputTextarea type="text" [(ngModel)]="approvedModel['approve_remarks']" ></textarea>
                          <div class="ui-message ui-messages-error ui-corner-all"  *ngIf="!constructionForm.controls['approve_opinion'].valid&&(!constructionForm.controls['approve_opinion'].untouched)" >
                            <i class="fa fa-close"></i>
                            审批意见必填
                          </div>
                      </div>
                  </div>
                <div class="ui-grid-row margin-bottom-1vw">

                  <div class="ui-grid-col-1 ui-padding-10px text-right">
                    <label >下一审批角色:</label>
                  </div>
                  <div class="ui-grid-col-3">
                    <input formControlName="next_approver_org"  type="text" pInputText
                           readonly class="cursor_not_allowed"  [(ngModel)]="approvedModel.next_approver_org" />
                    <div class="ui-message ui-messages-error ui-corner-all "   *ngIf="!constructionForm.controls['next_approver_org'].valid&&(!constructionForm.controls['next_approver_org'].untouched)" >
                      <i class="fa fa-close"></i>
                      下一审批角色必填
                    </div>
                  </div>
                  <div class="ui-grid-col-1">
                    <button pButton  type="button" (click)="showAddConstructionMask()" label="选择" ></button>
                  </div>
                  <div class="ui-grid-col-1">
                    <button pButton  (click)="clearTreeDialog()" label="清空" ></button>
                  </div>
                  <div class="ui-grid-col-1 text-right">
                    <label >下一审批人:</label>
                  </div>
                  <div class="ui-grid-col-5">
                    <p-dropdown [autoWidth]="false" formControlName="next_approver" name="fenlei"  [(ngModel)]="approvedModel.next_approver" [options] = "dropDownData"></p-dropdown>
                  </div>
                </div>
              </div>
          </p-panel>

          <div class="ui-grid-row margin-bottom-1vw">
              <div class="ui-grid-col-2">
              </div>
          </div>
          <label>设备列表</label>

          <p-dataTable [value]="devices"  [lazy]="true" [rows]="10" [paginator]="true"
                       [totalRecords]="totalRecords"  [(selection)]="selectInsepections" >
              <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>-->
              <p-column  *ngFor="let col of cols" field="{{col.field}}" header="{{col.header}}"></p-column>
              <ng-template pTemplate="emptymessage">
                  当前没有数据
              </ng-template>
          </p-dataTable>
      </form>
  </div>
    <div class="associatedEquipment" *ngSwitchCase="1" >
      <p-dataTable [value]="inspections"  [lazy]="true" [rows]="10" [paginator]="true"
                   [totalRecords]="totalRecords"  [(selection)]="selectInsepections" >
        <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>-->
        <p-column  *ngFor="let col of asscitedCols" field="{{col.field}}" header="{{col.header}}"></p-column>
        <ng-template pTemplate="emptymessage">
          当前没有数据
        </ng-template>
      </p-dataTable>
    </div>
    <div class="Operationlog" *ngSwitchCase="2">
      <p-dataTable [value]="inspections"  [lazy]="true" [rows]="10" [paginator]="true"
                   [totalRecords]="totalRecords"  [(selection)]="selectInsepections" >
        <!--<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>-->
        <p-column  *ngFor="let col of OperationLogCols" field="{{col.field}}" header="{{col.header}}"></p-column>
        <ng-template pTemplate="emptymessage">
          当前没有数据
        </ng-template>
      </p-dataTable>
    </div>
  </ng-container>
</div>
<app-add-construction-tree
  *ngIf="showAddConstruction"
  (closeAddMask)="closeConstruction($event)"
  (addTree)="addPlanOrg($event)"
  ></app-add-construction-tree>
